package com.mnsq.common.schedule;

import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import java.util.Calendar;

/**
 * @author 周俭
 */
@Component
@EnableScheduling
public class Timer {

    @Scheduled(cron = "0 0 0/5 * * ?")
    public void test() {
        Calendar calendar = Calendar.getInstance();
        int i = calendar.get(Calendar.HOUR_OF_DAY);
        if (i < 8 || i > 21) {
            return;
        }
        // TODO count the times of each type,update and remove
        // TODO email the new article or subject exam
    }
}
